#include<stdio.h>
#include<string.h>
void swap(int *x,int *y){
	int temp = *x;
	*x = *y;
	*y =temp;
}

void swap2(void *x,void *y, int size){
        char temp[size];
	memcpy(temp,x,size);
	memcpy(x,y,size);
	memcpy(y,temp,size);
}

int main(){
	int x= 1,y = 2;
	char* h=strdup("deng");char* w = strdup("liuhuisb2");
	swap2(h,w,sizeof(char*));
	printf("x=%d,y=%d\n",x,y);
	printf("h=%s,w=%s\n",h,w);
	printf("sizeof(char*) = %lu\n",sizeof(char*));
}
